<template>
	<view>
		<scroll-view class="list-scroll-content" scroll-y @scrolltolower="getData">
			<view class="goods-item u-flex" v-for="(item, index) in list" :key="index"> 
				<u-image width="200rpx" height="200rpx" :src="item.goods.cover_url"></u-image>
				<view class="right">
					<view>{{item.goods.title}}</view> 
					<view class="desc">{{item.goods.description}}</view>
					<view class="price">¥ {{item.goods.price}}</view>
				</view>
			</view>
		</scroll-view>
	</view>
	
</template>
<script>
	export default {
		data() {
			return {
				list: []
			}
		},
		onLoad(options) {
			this.getData()
		},
		methods:{
			async getData(){
				console.log('load');
				
				let { data, meta } = await this.$u.api.getCollects()
				this.list = data
			},
		}
	}
</script>
<style lang="scss" scoped>
	.list-scroll-content {
		height: 100%;
	}
	.goods-item{
		.desc{
			font-size: 14rpx;
			color: $u-type-info;
		}
		.price {
			margin-top: 40rpx;
			color: $u-type-error;
		}
	}
</style>